﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RMS.Utils.BootStrapper;
using RMS.Utils.RulesManager;
using Microsoft.Practices.ServiceLocation;
using RMS.Utils.Authentication;
using RMS.DataAccess.Entities;


namespace RMS.Web.Shell.Services
{
    class RulesService : IBootStrapperTask
    {
        public void Execute()
        {
            IRulesManager rulesManager = ServiceLocator.Current.GetInstance<IRulesManager>();
            rulesManager.RegisterNowRule<RadiologyRequest>(EntityState.Inserting, e => e.ReservationDate);
            rulesManager.RegisterCurrentUserRule<RadiologyRequest>(EntityState.Inserting, e => e.ReceptionEmpID);
            rulesManager.Register<RadiologyRequest>(EntityState.Inserting, m => m.RequestStatues = false);
            rulesManager.RegisterCurrentUserRule<RadiologyImage>(EntityState.Inserting, e => e.EmpID);
            rulesManager.RegisterNowRule<RadiologyImage>(EntityState.Inserting, e => e.ImageDate);
            rulesManager.RegisterCurrentUserRule<RadiologyReport>(EntityState.Inserting, e => e.DoctorID);
            rulesManager.RegisterNowRule<RadiologyReport>(EntityState.Inserting, e => e.reportDate);
         
        }
    }
}
